package com.xjrsoft.module.customer.erp_model.erpPurchaseRequsetInfo.vo;

import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import com.xjrsoft.common.Enum.TransDataType;
import com.xjrsoft.common.annotation.DataTrans;
import io.swagger.annotations.ApiModel;

/**
 * 视图实体类
 *
 * @author pp
 * @since 2021-09-24
 */
@Data
@ApiModel(value = "列表ErpPurchaserequsetVo对象", description = "列表ErpPurchaserequsetVo对象")
public class ErpPurchaserequsetListVo {

    @JsonProperty("F_Id")
    private String fId;

    @JsonProperty("F_DocunNumber")
    private String fDocunnumber;

    public String getfDocumentstatus() {
        String statusName = null;
        switch (this.fDocumentstatus) {
            case "1":
                statusName = "待审核";
                break;
            case "2":
                statusName = "审核通过";
                break;
        }
        return statusName;
    }

    @JsonProperty("F_DocumentStatus")
    private String fDocumentstatus;

    @JsonProperty("F_DocumentDate")
    private LocalDateTime fDocumentdate;

    @JsonProperty("F_ChargePeople")
    private String fChargepeople;

    @JsonProperty("F_DeliveryUnit")
    @DataTrans(dataType = TransDataType.DATA_SQL, dataCode = "localDB", sql = "	select i.F_Id,F_FullName from erp_inoutunit i where i.F_UniType=1", savedField = "F_Id", showField = "F_FullName", multi = false)
    private String fDeliveryunit;

    @JsonProperty("F_ApplicationPurposes")
    private String fApplicationpurposes;

    @JsonProperty("F_DeliveryDate")
    private LocalDateTime fDeliverydate;

    @JsonProperty("F_BudgetAmount")
    private String fBudgetamount;

    @JsonProperty("F_ActualAmount")
    private String fActualamount;

    @JsonProperty("F_Emergencylevel")
    @DataTrans(dataType = TransDataType.DATA_ITEM, dataCode = "Degree", multi = false)
    private String fEmergencylevel;

    @JsonProperty("F_Description")
    private String fDescription;

    @JsonProperty("F_CreatorUserId")
    @DataTrans(dataType = TransDataType.USER, multi = false)
    private String fCreatoruserid;

    @JsonProperty("F_CreatorTime")
    private LocalDateTime fCreatortime;

    //没有转换之前的值
    @JsonIgnore
    private Integer fInvalidmark;

    //返回的值
    @JsonProperty("F_InvalidMark")
    private String fInvalidmarkName;

    //转换方法
    public String getfInvalidmarkName() {
        String name = null;
        switch (this.fInvalidmark) {
            case 1 :
                name = "正常";
                break;
            case 2:
                name = "作废";
                break;
        }
        return name;
    }

    @JsonProperty("flowStatus")
    private String flowStatus;

    @JsonProperty("nwfSchemeinfoId")
    private String nwfSchemeinfoId;

    @JsonProperty("formId")
    private String formId;
}
